import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class boyntonGUI extends JFrame implements ActionListener{

    //Data Fields
    JComboBox startMonths;
    JLabel eventNameText;
    JTextField eventName;
    JLabel locationNameText;
    JTextField locationName;
    JLabel startText;
    JLabel endText;
    JComboBox endMonths;
    JComboBox startHours;
    JComboBox endHours;
    JComboBox startMinutes;
    JComboBox endMinutes;
    JComboBox startAMPM;
    JComboBox endAMPM;
    JComboBox startDays;
    JComboBox endDays;
    JTextField descriptionInput;
    JLabel descriptionText;
    JButton button_1;

/**
 * GUI Constructor
 *
 */
    public boyntonGUI() {
	 
	     //Layout
        boyntonGUILayout customLayout = new boyntonGUILayout();
        getContentPane().setFont(new Font("Helvetica", Font.PLAIN, 15));
        getContentPane().setLayout(customLayout);

        //Start Months
        startMonths = new JComboBox();
        startMonths.addItem("January");
        startMonths.addItem("February");
        startMonths.addItem("March");
        startMonths.addItem("April");
        startMonths.addItem("May");
        startMonths.addItem("June");
        startMonths.addItem("July");
        startMonths.addItem("August");
        startMonths.addItem("September");
        startMonths.addItem("October");
        startMonths.addItem("November");
        startMonths.addItem("December");
        getContentPane().add(startMonths);

        //Event
        eventNameText = new JLabel("Event Name:");
        getContentPane().add(eventNameText);
        eventName = new JTextField("");
        getContentPane().add(eventName);

        //Location
        locationNameText = new JLabel("Location:");
        getContentPane().add(locationNameText);
        locationName = new JTextField("");
        getContentPane().add(locationName);

        //Start Text
        startText = new JLabel("Start:");
        getContentPane().add(startText);
        //End Text
        endText = new JLabel("End:");
        getContentPane().add(endText);

        //End Months
        endMonths = new JComboBox();
        endMonths.addItem("January");
        endMonths.addItem("February");
        endMonths.addItem("March");
        endMonths.addItem("April");
        endMonths.addItem("May");
        endMonths.addItem("June");
        endMonths.addItem("July");
        endMonths.addItem("August");
        endMonths.addItem("September");
        endMonths.addItem("October");
        endMonths.addItem("November");
        endMonths.addItem("December");
        getContentPane().add(endMonths);

        //Start Hours
        startHours = new JComboBox();
        startHours.addItem("1");
        startHours.addItem("2");
        startHours.addItem("3");
        startHours.addItem("4");
        startHours.addItem("5");
        startHours.addItem("6");
        startHours.addItem("7");
        startHours.addItem("8");
        startHours.addItem("9");
        startHours.addItem("10");
        startHours.addItem("11");
        startHours.addItem("12");
        getContentPane().add(startHours);

        //End Hours
        endHours = new JComboBox();
        endHours.addItem("1");
        endHours.addItem("2");
        endHours.addItem("3");
        endHours.addItem("4");
        endHours.addItem("5");
        endHours.addItem("6");
        endHours.addItem("7");
        endHours.addItem("8");
        endHours.addItem("9");
        endHours.addItem("10");
        endHours.addItem("11");
        endHours.addItem("12");
        getContentPane().add(endHours);

        //Start Minutes
        startMinutes = new JComboBox();
        startMinutes.addItem("00");
        startMinutes.addItem("15");
        startMinutes.addItem("30");
        startMinutes.addItem("45");
        getContentPane().add(startMinutes);

        //End Minutes
        endMinutes = new JComboBox();
        endMinutes.addItem("00");
        endMinutes.addItem("15");
        endMinutes.addItem("30");
        endMinutes.addItem("45");
        getContentPane().add(endMinutes);

        //Start AM / PM
        startAMPM = new JComboBox();
        startAMPM.addItem("AM");
        startAMPM.addItem("PM");
        getContentPane().add(startAMPM);

        //End AM / PM
        endAMPM = new JComboBox();
        endAMPM.addItem("AM");
        endAMPM.addItem("PM");
        getContentPane().add(endAMPM);

        //Start Days
        startDays = new JComboBox();
        startDays.addItem("1");
        startDays.addItem("2");
        startDays.addItem("3");
        startDays.addItem("4");
        startDays.addItem("5");
        startDays.addItem("6");
        startDays.addItem("7");
        startDays.addItem("8");
        startDays.addItem("9");
        startDays.addItem("10");
        startDays.addItem("11");
        startDays.addItem("12");
        startDays.addItem("13");
        startDays.addItem("14");
        startDays.addItem("15");
        startDays.addItem("16");
        startDays.addItem("17");
        startDays.addItem("18");
        startDays.addItem("19");
        startDays.addItem("20");
        startDays.addItem("21");
        startDays.addItem("22");
        startDays.addItem("23");
        startDays.addItem("24");
        startDays.addItem("25");
        startDays.addItem("26");
        startDays.addItem("27");
        startDays.addItem("28");
        startDays.addItem("29");
        startDays.addItem("30");
        startDays.addItem("31");
        getContentPane().add(startDays);

        //End Days
        endDays = new JComboBox();
        endDays.addItem("1");
        endDays.addItem("2");
        endDays.addItem("3");
        endDays.addItem("4");
        endDays.addItem("5");
        endDays.addItem("6");
        endDays.addItem("7");
        endDays.addItem("8");
        endDays.addItem("9");
        endDays.addItem("10");
        endDays.addItem("11");
        endDays.addItem("12");
        endDays.addItem("13");
        endDays.addItem("14");
        endDays.addItem("15");
        endDays.addItem("16");
        endDays.addItem("17");
        endDays.addItem("18");
        endDays.addItem("19");
        endDays.addItem("20");
        endDays.addItem("21");
        endDays.addItem("22");
        endDays.addItem("23");
        endDays.addItem("24");
        endDays.addItem("25");
        endDays.addItem("26");
        endDays.addItem("27");
        endDays.addItem("28");
        endDays.addItem("29");
        endDays.addItem("30");
        endDays.addItem("31");
        getContentPane().add(endDays);

        //Description
        descriptionInput = new JTextField("");
        getContentPane().add(descriptionInput);
        descriptionText = new JLabel("Description of Event:");
        getContentPane().add(descriptionText);
 
        //Button
        button_1 = new JButton("Create Event");
        getContentPane().add(button_1);
        button_1.addActionListener(this);

        //Window
        setSize(getPreferredSize());
        addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
                System.exit(0);
            }
        });
    }
        public void actionPerformed(ActionEvent e) {
                iCalEvent myEvent;
                //numClicks++;
                //System.out.println(endDays.getSelectedItem());
                //System.out.println("Button Clicked " + numClicks + " times");
        }	 
	 
/**
 * Main Method
 */
    public static void main(String args[]) {
        boyntonGUI window = new boyntonGUI();

        window.setTitle("Boynton Event Creater");
        window.pack();
        window.show();
        //System.out.println(window.startMonths.toString());
     
    }
}//End Main Method


/**
 * GUI Layout Class
 */
class boyntonGUILayout implements LayoutManager {

    public boyntonGUILayout() {
    }

    public void addLayoutComponent(String name, Component comp) {
    }

    public void removeLayoutComponent(Component comp) {
    }

    public Dimension preferredLayoutSize(Container parent) {
        Dimension dim = new Dimension(0, 0);

        Insets insets = parent.getInsets();
        dim.width = 622 + insets.left + insets.right;
        dim.height = 482 + insets.top + insets.bottom;

        return dim;
    }

    public Dimension minimumLayoutSize(Container parent) {
        Dimension dim = new Dimension(0, 0);
        return dim;
    }

    public void layoutContainer(Container parent) {
        Insets insets = parent.getInsets();

        Component c;
        c = parent.getComponent(0);
        if (c.isVisible()) {c.setBounds(insets.left+88,insets.top+104,184,32);}
        c = parent.getComponent(1);
        if (c.isVisible()) {c.setBounds(insets.left+16,insets.top+24,72,24);}
        c = parent.getComponent(2);
        if (c.isVisible()) {c.setBounds(insets.left+88,insets.top+24,200,24);}
        c = parent.getComponent(3);
        if (c.isVisible()) {c.setBounds(insets.left+16,insets.top+56,72,24);}
        c = parent.getComponent(4);
        if (c.isVisible()) {c.setBounds(insets.left+88,insets.top+56,200,24);}
        c = parent.getComponent(5);
        if (c.isVisible()) {c.setBounds(insets.left+16,insets.top+104,72,24);}
        c = parent.getComponent(6);
        if (c.isVisible()) {c.setBounds(insets.left+16,insets.top+144,72,24);}
        c = parent.getComponent(7);
        if (c.isVisible()) {c.setBounds(insets.left+88,insets.top+144,184,32);}
        c = parent.getComponent(8);
        if (c.isVisible()) {c.setBounds(insets.left+376,insets.top+104,72,32);}
        c = parent.getComponent(9);
        if (c.isVisible()) {c.setBounds(insets.left+376,insets.top+144,72,32);}
        c = parent.getComponent(10);
        if (c.isVisible()) {c.setBounds(insets.left+448,insets.top+104,72,32);}
        c = parent.getComponent(11);
        if (c.isVisible()) {c.setBounds(insets.left+448,insets.top+144,72,32);}
        c = parent.getComponent(12);
        if (c.isVisible()) {c.setBounds(insets.left+520,insets.top+104,72,32);}
        c = parent.getComponent(13);
        if (c.isVisible()) {c.setBounds(insets.left+520,insets.top+144,72,32);}
        c = parent.getComponent(14);
        if (c.isVisible()) {c.setBounds(insets.left+272,insets.top+104,64,32);}
        c = parent.getComponent(15);
        if (c.isVisible()) {c.setBounds(insets.left+272,insets.top+144,64,32);}
        c = parent.getComponent(16);
        if (c.isVisible()) {c.setBounds(insets.left+16,insets.top+240,416,136);}
        c = parent.getComponent(17);
        if (c.isVisible()) {c.setBounds(insets.left+16,insets.top+216,152,24);}
        c = parent.getComponent(18);
        if (c.isVisible()) {c.setBounds(insets.left+16,insets.top+408,144,40);}
    }
}//End Layout Class
